import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:share_fit/app/controllers/home/exercise_records/components/exercise_type_view.dart';
import 'package:share_fit/app/controllers/home/exercise_records/logic.dart';

class ExerciseRecordsTitle extends StatelessWidget {
  ExerciseRecordsTitle({super.key});

  final logic = Get.find<ExerciseRecordsLogic>();

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      child: Wrap(
        spacing: 15.w,
        crossAxisAlignment: WrapCrossAlignment.center,
        children: [
          // 更新为用户所选的运动类型
          Obx(() => Text(logic.state.selectedExerciseType.getTypeName, style: TextStyle(fontSize: 45.sp))),
          Image.asset('assets/images/home/Inverted_triangle.png', width: 40.w, height: 40.w),
        ],
      ),
      onTap: () => Get.dialog(ExerciseTypePage()),
    );
  }
}
